//
//  APIConnection.h
//  Bracelet
//
//  Created by betta on 2/13/15.
//  Copyright (c) 2015 jing zhao. All rights reserved.
//

#import <Foundation/Foundation.h>

#import <AFNetworking/AFNetworking.h>

typedef void(^APIFinish)(id data);

typedef void(^Error)(NSError *error);
@interface APIConnection : NSObject

+ (APIConnection *) shareInstance ;

- (void) get:(NSString *)url
        data:(NSDictionary *)data
    netError:(Error)netError
   apiFinish:(APIFinish)apiFinish ;

- (void) post:(NSString *)url
         data:(NSDictionary *)data
    netError:(Error)netError
    apiFinish:(APIFinish)apiFinish ;

- (void) post:(NSString *)url
         data:(NSDictionary *)data
       header:(NSDictionary*)headerData
    netError:(Error)netError
    apiFinish:(APIFinish)apiFinish;


@end
